<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Gbw() {
        }
        // 通过Gbw.prototype给Gbw的原型（上一级）添加了car和house
        Gbw.prototype.car = '玛莎拉蒂';
        Gbw.prototype.house = '外滩18号';
        function FatherGtw (name) {
            this.name = name
        }
        // 高太尉的属性prototype就是高百万的prototype
        console.log(Gbw.prototype); // 这是一个对象，把这个对象赋值给高太尉
        FatherGtw.prototype = Gbw.prototype;
        FatherGtw.prototype.constructor = FatherGtw;
        var son1 = new FatherGtw ('高衙内');
        console.log(son1.name, son1.car, son1.house);
        console.log(son1.constructor);
        FatherGtw.prototype.car = '五菱 mini';
        console.log(Gbw.prototype);
    </script>
</body>
</html>